package com.ship.dispatch.bpm.task.listener;

import com.ship.dispatch.bpm.utils.ApplicationContextUtil;
import com.ship.dispatch.service.fob.FobService;
import com.ship.dispatch.service.fob.impl.FobServiceImpl;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 自定完成任务
 */
@Component("autoCompleteTaskEventListener")
public class AutoCompleteTaskEventListener implements TaskListener {
    FobService fobService;
    @Override
    public void notify(DelegateTask delegateTask) {
        // 参数
        Map<String, Object> variables = delegateTask.getVariables();
        String userId = variables.get("assigeners").toString();
        fobService = ApplicationContextUtil.getBean(FobServiceImpl.class);

    }
}
